<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Permissions'); ?></div>
    <?php 
        foreach(Yii::app()->admin->getFlashes() as $key => $message){
            echo '<div class="n_'.$key.'"><p>'.$message."</p></div>\n";
        }
    ?>
    <h2>Set Permission For Role "<?php echo $role['role_name']; ?>"</h2>
    <p>Allow this role perform the following operation:</p>
    
    <div class="entry">
        <div class="sep"></div>
    </div>
    
    <form action="" method="post" id="frmUser">
    <?php if(!empty($arrPermissions)): ?>
    
   <a href="javascript:void(0);" onclick="selectAll(true);">Check all</a> | <a href="javascript:void(0);" onclick="selectAll(false);">Uncheck all</a>
    
    <div class="element">
        <label>Permissions</label>
        <ul style="margin-top:10px; width: 345px; list-style-type: none;">
            <?php foreach($arrPermissions as $R): ?>
            <li style="padding-bottom: 8px; width: 340px;">
                <input type="checkbox" name="permissions[]" id="permission_<?php echo $R['permission_id']; ?>" <?php if(!empty($R['value'])): ?>checked="checked"<?php endif; ?> value="<?php echo $R['permission_id']; ?>"> 
                <label style="display:inline;" for="permission_<?php echo $R['permission_id']; ?>"><?php echo $R['permission_name']; ?></label>
            </li>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php else: ?>
    <div class="element">No permission found!</div>
    <?php endif; ?>
    
    <div class="entry">
    	<div class="sep"></div>	
        <input type="hidden" name="user[user_id]" value="">
        <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['user_id'])?$arrItemInfo['user_id']:null; ?>">
        <button type="submit">Submit</button> <button>Cancel</button>
    </div>
    </form>
</div>